import request from '~/utils/resquest'

// 灯具主列表
export const getAssetLampBaseList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/list',
    method: 'get',
    params
  })

// 导出灯具
export const exportAssetLampBaseInfo = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/export',
    method: 'get',
    responseType: 'blob',
    ...payload
  })

// 新增灯具 基础资料
export const addAssetLampBaseInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/add',
    method: 'post',
    data: params
  })

// 编辑灯具 基础资料 原内容
export const getAssetLampBaseInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/view',
    method: 'get',
    params
  })

// 编辑灯具 基础资料 提交
export const updateAssetLampBaseInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/update',
    method: 'post',
    data: params
  })

// 编辑灯具 地图位置
export const updateAssetLampBaseMapLocation = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/updateAddress',
    method: 'post',
    data: params
  })

// 校验灯具是否可删除
export const checkDeleteAssetLampBaseInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/checkRemove',
    method: 'post',
    params
  })

// 删除灯具
export const deleteAssetLampBaseInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampbase/remove',
    method: 'post',
    params
  })

// 获取灯具类型
export const getLampBaseTypeSelectList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampParam/selectBoxList',
    method: 'get',
    params
  })
